// phalanx apply_if.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

#ifndef IG_PHALANX_UTILITY_APPLY_IF_HPP_CU_ONCE_
#define IG_PHALANX_UTILITY_APPLY_IF_HPP_CU_ONCE_

#include <phalanx/config.hpp.cu>

#include <boost/mpl/if.hpp>
#include <boost/mpl/apply.hpp>

namespace phalanx
{

template < bool P, typename F, typename T >
struct apply_if_c
  : public ::boost::mpl::if_c<
      P,
      typename ::boost::mpl::apply< F, T >::type,
      T > {};

template < typename P, typename F, typename T >
struct apply_if
  : public apply_if_c< P::value, F, T > {};

template < bool P, typename F, typename C >
struct lazy_apply_if_c
  : public apply_if_c< P, F, typename C::type > {};

template < typename P, typename F, typename C >
struct lazy_apply_if
  : public lazy_apply_if_c< P::value, F, C > {};

} // namespace phalanx

#endif // IG_PHALANX_UTILITY_APPLY_IF_HPP_CU_ONCE_

